package com.heima.fallback;

import com.heima.feign.ArticleFeignClient;
import com.heima.feign.WemediaFeignClient;
import com.heima.model.common.dtos.ResponseResult;
import feign.hystrix.FallbackFactory;

/**
 * 自媒体微服务远程调用服务降级方案
 * @author chenshan
 */
public class WemediaClientFallback implements FallbackFactory<WemediaFeignClient> {
    @Override
    public WemediaFeignClient create(Throwable throwable) {
        return new WemediaFeignClient() {
            @Override
            public ResponseResult<Boolean> checkContent(String content) {
                return ResponseResult.errorResult(5000, "远程调用失败~");
            }
        };
    }
}
